#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    string c;
    string str;
    cin >> n >> c;
    getchar();
    getline(cin, str);
    int len = str.length();
    if (len < n) {
        string res = "";
        int cnt = n - len;
        while (cnt --) res += c;
        res += str;
        cout << res << endl;
    } else {
        str.substr(len - n);
        cout << str << endl;
    }
    return 0;
}